import useCurrent from "./useInstance";

export default function () {
    const current = useCurrent();

    const openConfirm = (title, message, callback) => {
        current.$messageBox
            .confirm(message, title, {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
            })
            .then((res) => callback?.(res))
            .catch((e) => e);
    };

    return openConfirm;
}
